# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=python-pyahocorasick
_name=pyahocorasick
pkgver=2.0.0
pkgrel=2
pkgdesc='Python module (C extension and plain python) implementing Aho-Corasick algorithm'
url='https://github.com/WojciechMula/pyahocorasick'
arch=('loong64' 'x86_64')
license=('BSD-3-Clause')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
b2sums=('0cc0e7de18c035e3f6b0dff7da421df8ea47c7d2d93ba8b5e2fa4f3b36e11efa688b0d67c5224e7cc55e6d410f86a2af3502d482c7c0a8db6d45d0518216625e')

build() {
  cd "${_name}-${pkgver}"
  python -m build --wheel --no-isolation
}

check() {
  cd "${_name}-${pkgver}"
  PYTHONPATH=. python -c 'import src'
}

package() {
  cd "${_name}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -D LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim:set ts=2 sw=2 et:
